<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
	 <meta charset="UTF-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0">

                <title>Knowledge Base Theme</title>

                <link rel="shortcut icon" href="images/favicon.png" />


                

                <!-- Style Sheet-->
                <link rel="stylesheet" href="style.css"/>
                <link rel='stylesheet' id='bootstrap-css-css'  href='css/bootstrap5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='responsive-css-css'  href='css/responsive5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='pretty-photo-css-css'  href='js/prettyphoto/prettyPhotoaeb9.css?ver=3.1.4' type='text/css' media='all' />
                <link rel='stylesheet' id='main-css-css'  href='css/main5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='blue-skin-css'  href='css/blue-skin5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='custom-css-css'  href='css/custom5152.html?ver=1.0' type='text/css' media='all' />
				<link rel="stylesheet" href="css/no-show.css" type="text/css" />
	
                <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
                <!--[if lt IE 9]>
            <script src="js/html5.js"></script></script>
                <![endif]-->
<title></title>  
<style>  
.keleyitable {  
width: 800px;  
}  
  
.keleyitable table, td, th {  
margin-top:10px;  
}  
.klytd {width:100px;text-align:right  
}  
.hvttd {  
width:500px}  
</style>  
  <meta charset="UTF-8" />
</head>  
<body>
<div id="app">
<div class="header-wrapper">

	<div class="container" >


		<div >
			<!-- Website Logo -->
			<a href="main.html"   >
				<img src="images/taru.jpg"
					 style="height:60px;">
			</a>
			<span class="tag-line">塔里木大学</span>
		</div>


		<!-- Start of Main Navigation -->
		<nav class="main-nav">
			<div class="menu-top-menu-container">
				<ul id="menu-top-menu" class="clearfix">
					<li class="current-menu-item"><a href="main.html">Home</a></li>
					<li><a href="#">科普模块</a>
						<ul class="sub-menu">
							<li><a @click="pes"  href="disease-list.html">虫害科普</a></li>
							<li><a @click="pesCon" href="disease-list.html">虫害防治</a></li>
							<li><a @click="dis" href="disease-list.html">病害科普</a></li>
							<li><a @click="disCon" href="disease-list.html">病害防治</a></li>
						</ul></li>
					<li><a href="exchange-list.html">讨论模块</a></li>
					<li><a href="forecast.html">数据预测</a></li>
					<li><a href="#">用户信息</a>
						<ul class="sub-menu">
							<li><a href="selectUser.html">查看用户信息</a></li>
							<li><a href="updateUser.html">修改用户信息</a></li>
							<li><a href="updateUserPassword.html">修改用户密码</a></li>
						</ul>
					</li>
					<li v-if="flag"><a href="#">管理员模块</a>
						<ul class="sub-menu">
							<li><a href="disease-list-statue.html">文章审核</a></li>

						</ul>
					</li>

				</ul>
			</div>
		</nav>
		<!-- End of Main Navigation -->

	</div>

</div>
                
                <div style="margin:0px auto;" class="keleyitable"><h2>预测</h2>  
                <div  style="margin:0 auto; width:600px;  ">
                <table style="  width: 600px;margin-top:50px;">
                	<tr>
                		<td style="  width: 100px; height: 50px;">声明：</td>
                		<td style="  width: 500px;">
						<span>1：预测结果只供参考使用</span>
						</td><br>
                	</tr>
                	
                	<tr>
                		<td style="  width: 100px; height: 50px;">病虫害类型：</td>
                		<td style="  width: 500px;">
                			<select v-model="Sort" name="que1" id="que1" style="width: 515px; height: 40px; margin-top:8px;"	>  
							<!--
                            	1是虫害
                            	2是虫害防治
                            	3是病害
                            	4是病害防治
                            -->
							<option value="枣瘿蚊">枣瘿蚊</option> 
							<option value="枣树叶螨">枣树叶螨</option> 
							<option value="截形叶螨">截形叶螨</option> 
							</select>
                		</td>
                	</tr>
                	<tr>
                		<td style="  width: 100px; height: 50px;">温度：</td>
                		<td style="  width: 500px;">
                			<input v-model="datesTemperature" placeholder="请输入温度/摄氏度"  style="width: 500px; margin-top:8px;" type="text" name="phon" id="phon" class="required input-xlarge" value="" >
                		</td>
                	</tr>
                	<tr>
                		<td style="  width: 100px; height: 50px;">湿度：</td>
                		<td style="  width: 500px;">
                			<input v-model="datesHumidity" placeholder="请输入相对湿度/百分比"  style="width: 500px; margin-top:8px;" type="text" name="phon" id="phon" class="required input-xlarge" value="" >
                		</td>
                	</tr>
                	<tr  v-if="ans">
                		<td style="  width: 100px; height: 50px;">预测结果：</td>
                		<td style="  width: 500px;">
                			<input v-model="num" readonly="readonly"  style=" border:none; width: 200px; margin-top:8px;" type="text" name="phon" id="phon" class="required input-xlarge" value="" >
                		    <input v-model="unit" readonly="readonly"   style=" border:none; width: 50px; margin-top:8px;" type="text" name="phon" id="phon" class="required input-xlarge" value="" >

                		</td>
                	</tr>
                	<tr v-if="ans">
                			<td style="  width: 100px; height: 50px;">预测结果图：</td>
                		<td style=" width: 600px; height: 300px;"> <img :src="image" ></td>
                		
                	</tr>
                	<tr> 	
                		<td >
                			
                		</td>
                		<td >
                			<input @click="yc" class="btn" name="submit" type="submit" id="submit" style="width: 200px; height: 50px;"  value="提交" style=" height: 50px;">
                		</td>
                	</tr>
                	 
                </table>
				
				   
				  
					
				 </div>
				
				  
				</div>
</div>
 				<script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
                <script type='text/javascript' src='js/jquery.easing.1.34e44.js?ver=1.3'></script>
                <script type='text/javascript' src='js/prettyphoto/jquery.prettyPhotoaeb9.js?ver=3.1.4'></script>
                <script type='text/javascript' src='js/jquery.liveSearchd5f7.js?ver=2.0'></script>
				<script type='text/javascript' src='js/jflickrfeed.js'></script>
                <script type='text/javascript' src='js/jquery.formd471.js?ver=3.18'></script>
                <script type='text/javascript' src='js/jquery.validate.minfc6b.js?ver=1.10.0'></script>
                <script type='text/javascript' src='js/custom5152.js?ver=1.0'></script>
                  <script type="text/javascript" src="js/url.js"></script>
				<script type="text/javascript" src="js/vue(1).js"></script>
				<script type="text/javascript" src="js/axios.min.js"></script>
				<script>
					   
					var vue = new Vue({
						el: '#app', //挂载点
						data: {
							datesHumidity:'',
							Sort:'',
							datesTemperature:'',
							userId:'',
							num:'',
							unit:'',
							images:'',
                            flag:false,
							ans:false
						},
						dataType:'JSONP',  // 处理Ajax跨域问题
						created: function() {
                            this.userOrAdmin();
						},
						methods: {
                            userOrAdmin: function(){
                                var self = this;
                                var userSort = window.sessionStorage.getItem("userSort");
                                console.log(userSort)
                                if(userSort == 2 ){
                                    self.flag = true;
                                }
                            },
							yc: function() {
								var self = this;
								self.userId = window.sessionStorage.getItem("userId");
									var param=new URLSearchParams();	
									param.append('datesHumidity',self.datesHumidity);
									param.append('datesSort',self.Sort);
									param.append('datesTemperature',self.datesTemperature);
									param.append('userId',self.userId);
									param.append('dataBatchNumber','2019');
									axios
									.post(web_server+"insert/data",param)
										.then(function(response) {
											//var object =JSON.stringify(response)
											var objects= response.data;
											if(objects.status == 200) {
												var object = objects.data
												self.num = object;
												console.log(object)
												self.tj();
											}else if(objects.status == 500){
												alert(objects.message)
											}
										})
									.catch(function(error) {
										alert(error)
										
									});
							},tj: function() {
								var self = this;
								console.log("")
									var param=new URLSearchParams();	
									param.append('analiseDetailes',self.num);
									param.append('userId',self.userId);
									param.append('dataBatchNumber','2019');
									if(self.num != null && self.Sort == "枣瘿蚊"){
										self.ans = true;
										self.image = 'images/zaoyingwenchong.png'
										console.log(self.image)
										self.unit = '头/板'
									}else if(self.num != null && self.Sort == "截形叶螨"){
										self.ans = true;
										self.image = 'images/jiexingyeman.png'
										self.unit = '头/叶'
									}else if(self.num != null && self.Sort == "枣树叶螨"){
										self.ans = true;
										self.unit = '头/叶'
										self.image = 'images/zaoshuyeman.png'
									}
									
									axios
									.post(web_server+"insert/anasile/result",param)
										.then(function(response) {
											//var object =JSON.stringify(response)
											var objects= response.data;
											if(objects.status == 200) {
												var object = objects.data
											}else if(objects.status == 500){
												alert(objects.message)
											}
										})
									.catch(function(error) {
										alert("发帖成功")
										
									});
							},
                            pes:function(){
                                window.sessionStorage.setItem("sort", "1");
                            },
                            pesCon:function(){
                                window.sessionStorage.setItem("sort", "2");
                            },
                            dis:function(){
                                window.sessionStorage.setItem("sort", "3");
                            },
                            disCon:function(){
                                window.sessionStorage.setItem("sort", "4");
                            }
							
						}
					})
				</script>
</body>  
</html>